package com.group3.group3.baobiao.priceinfo.service.impl;


import com.group3.group3.baobiao.priceinfo.entity.PriceinfoSearchEnity;
import com.group3.group3.baobiao.priceinfo.repository.PriceinfoDao;
import com.group3.group3.baobiao.priceinfo.service.PriceinfoService;
import com.group3.group3.mybatis.entity.InternationalOfferEntity;
import com.group3.group3.mybatis.entity.InternationalPriceEntity;
import com.group3.group3.mybatis.flexigrid.PadingRstType;
import com.group3.group3.mybatis.flexigrid.PagingBean;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Hhw-byte
 * @create 2022-05-16 11:10
 */
@Service("priceinfoService")
public class PriceinfoServiceImpl implements PriceinfoService {

    @Resource//将UserDao注入进来，就可以通过userDao访问UserDao接口中的方法
    private PriceinfoDao priceinfoDao;

    @Override
    public PadingRstType<InternationalPriceEntity> getPriceinfoListByPage(PriceinfoSearchEnity search, PagingBean paging) {
        paging.deal(InternationalPriceEntity.class);
        PadingRstType<InternationalPriceEntity> padingRstType = new PadingRstType<>();
        padingRstType.setPage(paging.getPage());
        List<InternationalPriceEntity> list = priceinfoDao.queryPriceinfoListByPage(search, paging);
        Integer total = priceinfoDao.queryPriceinfoListTotal(search);
        padingRstType.setRawRecords(list);
        padingRstType.setTotal(total);
        padingRstType.putItems();
        return padingRstType;
    }



}






